package com.crm.miaohe.controller;

import com.crm.miaohe.config.HttpClientProperties;
import com.crm.miaohe.config.K3CloudApiProperties;
import com.crm.miaohe.service.K3CloudApiService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/test")
public class TestController {

    private final HttpClientProperties properties;
    private final K3CloudApiProperties properties1;
    private final K3CloudApiService k3CloudApiService;

    public TestController(HttpClientProperties properties,
                          K3CloudApiProperties properties1,
                          K3CloudApiService k3CloudApiService) {
        this.properties = properties;
        this.properties1 = properties1;
        this.k3CloudApiService = k3CloudApiService;
    }

    @GetMapping
    public ResponseEntity<Boolean> test() {
        System.out.println(properties.getBufferSize());
        System.out.println(properties1.getUrl());
        boolean res = k3CloudApiService.login();
        return ResponseEntity.ok(res);
    }
}
